{{ $s := .Site}}
{{ $name := .Get "name" }}
{{ $title := .Get "title" }}
{{ $language := .Get "language" }}
{{ $languages := .Site.Data.languages }}
{{ range where $languages "name" $language }}
  {{ $languageName := .name }}
  {{ $languageExtension := .extension }}
  {{ $examplePath := printf "/content/examples/%s/%s.%s" $languageName $name $languageExtension | safeURL }}
  <details open>
    <summary>{{ $name }}: {{ $title }} in {{ $languageName }}</summary>
      {{ if fileExists $examplePath }}
          <div class="markdown-inner">
            {{ highlight (readFile $examplePath) $languageName "" }}
          </div>
          <div class="book-footer" style="padding: 0">
              <a class="flex align-center" href="{{ $s.Params.BookRepo }}/edit/master/{{ printf "/examples/%s/%s.%s" $languageName $name $languageExtension | safeURL }}" target="_blank" rel="noopener">
              <img src="{{ "svg/edit.svg" | relURL }}" class="book-icon" alt="Edit" />
              <span>Edit this example</span>
            </a>
          </div>
      {{ else }}
          <div class="markdown-inner">
              The example <strong>{{ $name }}</strong> is missing in <strong>{{ .name }}</strong>:
              <a href="/translate">Contribute Translation</a>
          </div>
      {{ end }}
    </summary>
  </details>
  <br/>
{{ end }}
